<?php


namespace App\Admin\Actions\Post;


use App\Admin\Actions\RowAction;
use App\Transverse;

class TransverseCompletePost extends RowAction
{
    public $name = '结项';

    public function handle(Transverse $model)
    {
        $model->state = 1;
        $model->end_time = request()->get('end_time');
        $model->save();
        return $this->response()->success('操作成功！')->refresh();
    }

    public function form()
    {
        $this->date('end_time', '结项时间')->rules('required',['required'=>'结项时间不能为空']);
    }
//    public function dialog()
//    {
//        return $this->confirm('确定结项吗？');
//    }
}
